package com.mfhcd.facepay.adapter;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.mfhcd.facepay.R;
import com.mfhcd.facepay.viewholder.MultiViewHolder;

import java.util.List;

/**
 * Author：石强
 * E-Mail: shiqiang@mfhcd.com
 * Date：2019-09-19
 * 版权所有 © 现代金融控股（成都）有限公司
 * 多类型布局基础类
 */
public abstract class BaseMultiAdapter<T extends MultiItemEntity> extends BaseMultiItemQuickAdapter<T, MultiViewHolder> {

    public BaseMultiAdapter(@Nullable List<T> data) {
        super(data);
    }

    @Override
    protected int getDefItemViewType(int position) {
        return super.getDefItemViewType(position);
    }

    @Override
    protected View getItemView(int layoutResId, ViewGroup parent) {
        ViewDataBinding binding = DataBindingUtil.inflate(mLayoutInflater,layoutResId,parent,false);
        View view = binding.getRoot();
        view.setTag(R.id.BaseQuickAdapter_databinding_support, binding);
        return view;
    }


}
